﻿verifyApp.factory("VerificationService", function ($http, $q) {
    return {
        getContacts: function () {
            var deferred = $q.defer();
            $http({ method: 'GET', url: '/Verify/GetContact' }).success(deferred.resolve).error(deferred.reject);
            return deferred.promise;
        },
        sendVerificationCode: function () {
            var deferred = $q.defer();
            $http({ method: 'GET', url: '/Verify/SendVerificationCode' }).success(deferred.resolve).error(deferred.reject);
            return deferred.promise;
        },
        activateAccount: function (code) {
            var deferred = $q.defer();
            $http({ method: 'GET', url: '/Verify/Activate/' + code }).success(deferred.resolve).error(deferred.reject);
            return deferred.promise;
        }
    }
});